﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;

namespace Hengbei.BLL
{
    public class ApplicationRoleProvider : SqlRoleProvider
    {
        public override bool IsUserInRole(string username, string roleName)
        {
            bool hasPassedValidation = false;
            hasPassedValidation = UserService.IsUserInRole(username, roleName);
            return hasPassedValidation;
        }

        public override string[] GetRolesForUser(string userName)
        {
            List<string> roles = new List<string>();
            roles.AddRange(UserService.GetAllRoles(userName));
            return roles.ToArray();
        }
    }
}
